//
//  cCOtherLogins.m
//  cyChat
//
//  Created by 楼楚 on 15/11/28.
//  Copyright © 2015年 Chu Lou. All rights reserved.
//

#import "cCOtherLogins.h"
#import "AppDelegate.h"


@interface cCOtherLogins ()
@property (weak, nonatomic) IBOutlet UITextField *userField;
@property (weak, nonatomic) IBOutlet UITextField *pwdField;
@property (weak, nonatomic) IBOutlet UIButton *loginBtn;

@end
@implementation cCOtherLogins
- (void)viewDidLoad
{
    [super viewDidLoad];
    self.title = @"其他方式登录";
    
    self.userField.background=[UIImage stretchedImageWithName:@"operationbox_text"];
    self.pwdField.background = [UIImage stretchedImageWithName:@"operationbox_text"];
    [self.loginBtn setBackgroundImage:[UIImage imageNamed:@"fts_green_btn" ] forState:UIControlStateNormal];
    [self.loginBtn setBackgroundImage:[UIImage imageNamed:@"fts_green_btn_HL"] forState:UIControlStateHighlighted];
    
    
//    [self.loginBtn setN_BG:@"fts_green_btn" H_BG:@"fts_green_btn_HL"];
}
- (IBAction)loginBtnClick
{
    //    登录
    /*
     官方的登录实现
     1 把密码和用户名放在cCUserInfo的单例
     2 调用AppDelegate的一个login 连接服务并登录
     
     */
    
    
    cCUserInfo *userInfo = [cCUserInfo sharedcCUserInfo];
    
    userInfo.user = self.userField.text;
  
    userInfo.pwd = self.pwdField.text;
    [self login];
    
   }


- (IBAction)cancel:(id)sender {
    
    
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)dealloc
{
    NSLog(@"%s",__func__);
}
@end
